/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.sunspotworld;

import com.sun.spot.resources.transducers.LEDColor;

/**
 *
 * @author me
 */
public class BlinkState {
    
    public static final byte OFFLINE = 0;
    public static final byte ONLINE_NOTBLINK = 1;
    public static final byte ONLINE_BLINK = 2;

    private byte state;
    private LEDColor color;

    public BlinkState(byte state, LEDColor color) {
        this.state = state;
        this.color = color;
    }

    public BlinkState(byte state, byte red, byte green, byte blue) {
        this.state = state;
        this.color = new LEDColor(red & 0xFF, green & 0xFF, blue & 0xFF);
    }

    public byte getRed() {
        return (byte)color.red();
    }

    public byte getGreen() {
        return (byte)color.green();
    }

    public byte getBlue() {
        return (byte)color.blue();
    }

    public byte getState() {
        return state;
    }

    public void setColor(LEDColor color) {
        this.color = color;
    }

    public void setState(byte state) {
        this.state = state;
    }

    public LEDColor getColor() {
        return color;
    }
}
